/*
 * @Author: yangzonglong
 * @Date: 2021-05-11 15:26:13
 * @version: v1.0.0
 * @Descripttion: 
 * @LastEditors: yangzonglong
 * @LastEditTime: 2021-09-06 15:10:47
 * @Auditor: 
 */

import { units } from '@library';


interface GetFormProps {
  content: string,
  enviromentConfig?: string,
  formDesc: string,
  formName: string;
}

export async function getForm(id: string): Promise<GetFormProps> {
  try {
    const result: GetFormProps = await units.serverLoading(`/bk/api/fd/Form/findOne`, { where: { id } });
    return result;
  } catch (error) {
    return {
      content: '{"list":[]}',
      formDesc: '',
      formName: ''
    };
  }
}